· 1 minute read

Refactoring code

After a month of developing and nonstop iterating, the code you write tends to get a little... ugly.
I figured it's time to change that.

I went through the code and looked at what could be grouped into functions and what the best way would be. I wanted to clean up my init function a lot, so I refactored each 'part' of it into it's own tidy function. This way I can just call initFunctionName() in the init() function and everything looks neat and is easy to read and understand.

Splitting the code up into functions will also allow me to load different songs and lyrics using the same functions. I hope to expand on this soon with a song selector.